The present invention relates to a data processing apparatus and data processing method for converting color data into monochrome data to be outputted, and more particularly, to a controlling method of controlling a printer by utilizing a monochrome image printer driver for processing a printer control command transmitted from a host computer to a printer.
When a printer is connected to a host computer to output a print image, the host computer must have an interface corresponding to the printer. Recently computers generally include an OS (Operating System). In order to eliminate limitations of connectable types of printer, a printer driver is installed for each type of printers to maintain compatibility between the printer and OS.
Description will be provided, with reference to FIG. 10, on a printer driver for a conventional monochrome image printer which is connected to a host computer. FIG. 10 is a diagram explaining process of a general image driver.
The host computer includes an OS (Operating System) for controlling interface (I/F) between a device and an application program. The application program 201 and a printer driver exchange data through the API 202.
In a case where the application program 201 performs image rendering process for drawing a figure by combining an image, drawing, characters or the like, source image data, coordinates for strokes of the drawing, color information, character font information and so forth are transmitted to the printer driver through the API 202.
In the printer driver, an image processing module 203 performs image processing appropriate for the target printer device in accordance with the type of image and characters. The processed data is transferred to a renderer 204 of the printer driver for performing rendering process on a rendering plane 205 which serves as a memory space.
The rendering plane 205 may be provided for one page, or may be provided as a band memory where one page is divided into plural bands, in accordance with the memory size of the system and the number of tones in a bitmap image. After rendering is performed on the rendering plane 205, a rasterizer 206 converts the rendering data, rendered on the rendering plane 206, into monochrome image data in the form which can be transferred to an image printer 207. Then, the image is printed by the image printer 207.
The printer driver can set a bit per pixel (BPP) value for the rendering plane 205.
If an application program is started in the host computer and color image data is generated, data transmitted from the application program to the printer driver is color data. In the conventional technique, in order to accurately superimpose each color of an image, it is ideal to process the data in unit of 24 BPP (24 BPP: 1 pixel is expressed by R, G, B values each having 8 bits) as shown in the box indicated by reference numeral 208.
However in a monochrome 1 BPP printer, it is inefficient to use memory space for 24 BPP. Therefore, there are ways to set a rendering plane to 8 BPP (209), or 1 BPP (210).
Note that 8 BPP (bit per pixel) and 1 BPP (bit per pixel) indicate that the number of bits allocated to one pixel is 8 bits and 1 bit respectively. In the case of 8 BPP, values from 0 to 255 can be expressed. Normally, color component data each color having 8 bits is allocated to a palette code expressed by 8 BPP palette.
The conventional process of converting color image data into monochrome image data, using 24 BPP rendering plane, is now described in detail with reference to FIG. 11.
An object image rendered by the application program is transferred to a driver I/F 301 in unit of the object type (graphics 304, image 308). If the rendered object is graphics, the object data transferred to the driver I/F 301 includes coordinate data for a stroke representing a contour of the graphics, and R, G and B data indicative of a color of the contour or a color inside the graphics. If the rendered object is image data, color values of a source image are transferred to the printer driver 305 without being processed.
The printer driver 305 transfers the received data to the system I/F 302 without further processing. The system I/F 302 transfers the data to the rendering system 306 which performs rendering process in the 24 BPP band memory.
Upon completion of rendering all the objects in the 24 BPP band memory, the rendering system 306 transfers the head address of the band memory to the printer driver (rasterizer 307) through the driver I/F 303. The rasterizer 307 derives color values, pixel by pixel, from the head address of the band memory, and performs color conversion, monochrome conversion, binarization, and generate data to be transmitted to a printer.
Next, a conventional process using 8 BPP rendering plane is described in detail with reference to FIGS. 12 and 13. Only few monochrome printer drivers employ this method. However, this technique is generally used for displaying on a color display unit.
Reference numeral 406 in FIG. 12 denotes a color palette for outputting color data using 8 BPP rendering plane, based on color values transferred from the application program in the host computer.
Each of the palette numbers 401 is set by the three primary colors: red, green, and blue, each having respectively values (each color having 8 bits) to express various colors. Conventionally, each color changes at a constant rate as shown in FIG. 12 so that the colors are evenly distributed in the color space.
FIG. 13 shows a process of a monochrome printer driver using a conventional color palette as shown in FIG. 12 where each color is evenly distributed in the color space.
In the initial setting of the system, a color palette 501 (FIG. 13) is registered. An object rendered in the application program side is transferred to a driver I/F 502 in unit of the object type (graphics 506, image 511, character 512).
If the rendered object is graphics, the object data transferred to the driver I/F 502 includes coordinate data for a stroke representing a contour of the graphics, and R, G and B data indicative of a color of the contour or a color inside the graphics. If the rendered object is image data, color values of a source image are transferred to the printer driver 513 without being processed. Note that there is an operating system (OS) (e.g., Microsoft Windows NT 4.0) which designates the color of a character by using a color palette number registered in the system.
The printer driver 513 transfers the received data to the system I/F 503 without further processing. The system I/F 503 transfers the data to the rendering system 508 which performs rendering process in the 8 BPP band memory. The system searches for a palette number, and if the system finds an appropriate color in the color palette 501, rendering process is performed using the value in the color palette. If the system does not find an appropriate color in the palette 501, a color mixture pattern is generated with neighboring colors (dither process) and rendering process is performed.
Upon completion of rendering all the objects in the 8 BPP band memory, the rendering system 508 transfers the head address of the band memory to the printer driver (rasterizer 510) through the driver I/F 504. The rasterizer 510 derives color values, pixel by pixel, from the head address of the band memory, and performs color conversion, monochrome conversion, binarization, and generate data to be transmitted to a printer.
In monochrome image data generation, high image quality can be achieved if a 24 BPP rendering plane is used. However, using 24 BPP rendering plane requires a large memory capacity for the rendering area, and decreases speed because color conversion processing has to be performed on all pixels after rendering operation.
On the other hand, if a 1 BPP rendering plane or 8 BPP rendering plane is used, the process speed increases compared to the 24 BPP rendering plane, but the image quality is deteriorated because of the halftone process performed when the renderer 204 of the system expresses color data in 1 BPP or 8 BPP.
The present invention is made in consideration of the above situation, and has as its object to provide a data processing apparatus which solves the aforementioned problems.
Another object of the present invention is to provide a data processing apparatus capable of generating output data by converting color image data to monochrome image data and outputting a high-quality monochrome image without causing excessive data loss.
Another object of the present invention is to provide a data processing apparatus capable of outputting high-quality image at high speed.